//
//  UIBarButtonItem+Extension.m
//  WisdomCommunity
//
//  Created by yahaong on 16/7/25.
//  Copyright © 2016年 zonten. All rights reserved.
//

#import "UIBarButtonItem+Extension.h"
#import "UIView+Frame.h"
@implementation UIBarButtonItem (Extension)
+ (nonnull UIBarButtonItem *)createBarbuttonItem:(nonnull NSString *)image target:(nullable id)target action:(nonnull  SEL)action
{
    UIButton *button = [[UIButton alloc]init];
    [button setImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    button.yh_size = button.currentImage.size;
    [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *item  = [[UIBarButtonItem alloc]initWithCustomView:button];
    return item;
}



@end
